<script src="{{ getAssets }}js/jquery.freezeheader.js?v={{ assets_version }}"></script>
<script language="javascript">
$('#closeWin').click(function(){
	var index = parent.layer.getFrameIndex(window.name);
	parent.layer.close(index);
	return false;	
});

$('#determine').click(function(){
	$('.diopter_astigmatism').each(function(k, v) {
        var val = $(v).val();
		if(val != '') {
			var diopterType = $('[name="diopter"]:checked').val();
			var astigmatismType = $('[name="astigmatism"]:checked').val();
			
			diopter = $(v).attr('diopter');
			if(diopterType == 0 && diopter > 0) {  //负值
				diopter = '-' + diopter;
			} else {
				diopter = diopter > 0 ? '+' + diopter : '-' + diopter;
			}
			astigmatism = $(v).attr('astigmatism');
			if(astigmatismType == 0 && astigmatism > 0) {  //负值
				astigmatism = '-' + astigmatism;
			}else {
				astigmatism = astigmatism > 0 ? '+' + astigmatism : '-' + astigmatism;
			}
			parent.setGlassesStandard(val, diopter, astigmatism);
		}
    });	
	layer.msg('添加产品成功');
	$('.diopter_astigmatism').val('');
	//parent.layer.closeAll('iframe');
});

$(document).ready(function () {
	$("#tableid").freezeHeader();
});

$('.nowtd').mouseover(function(){
	var row = $('#tableid tbody>tr').length;
	var col = $(this).index();
	for(var i=0;i<row;i++) {
		$('#tableid tbody>tr').eq(i).children('td').eq(col).addClass('fg');
	}
}).mouseout(function(){
	$('#tableid tbody>tr>td').removeClass('fg');
});

</script>